﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class SpacePicSelect : MonoBehaviour {

    public GameObject[] SpacePic;
    public Button feather;

	// Use this for initialization
	void Start ()
    {
        feather.onClick.AddListener(FeatherBack);
        string name = BallCollider.Instance.name;
        if (name== "NorthAtlanticOcean")
        {
            SpacePic[1].SetActive(true);
        }
        else if (name == "AmazonRainforest")
        {
            SpacePic[0].SetActive(true);
        }
        else if (name == "SweetVeld")
        {
            SpacePic[2].SetActive(true);
        }
	}
	
	void FeatherBack()
    {
        //for (int i = 0; i < SpacePic.Length; i++)
        //{
        //    SpacePic[i].SetActive(false);
        //}
        GameObject.Find("EventSystem").GetComponent<AudioSource>().Stop();
        RollBall.Instance.canRoll = true;
        Destroy(gameObject);
    }
}
